package com.jgp.sys.sms;

import com.jgp.common.utils.JGPUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目   jgp-cloud-parent
 * 作者   loufei
 * 时间   2019-06-02
 */
public class SmsData {
    private String tel;
    private String template;
    private Map<String,String> data;
    
    public SmsData(String tel,String template) {
        this.tel = tel;
        this.template = template;
        data = new HashMap<>();
    }
    
    public SmsData addData(String key, String value){
        data.put(key,value);
        return this;
    }
    
    public SmsData putAllData(Map<String,String> data){
        data.putAll(data);
        return this;
    }
    
    public String tel(){
        return this.tel;
    }
    
    @Override
    public String toString() {
        return JGPUtil.template(this.template,this.data);
    }
}
